<%--
 *  File:    NotesInfo.jsp
 *  @Author: Vector mao
 *  Date:    2/20/2002 13:56
 *
 *  Copyright (C) 2000 - 2002 Oval Technologies, Inc.
 *  All rights reserved.
 *
 *  This software is the confidential and proprietary information of Oval
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>


<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>
<%@ page import="java.util.*" %>
<%@ page import="java.net.*" %>
<%@ page import="org.apache.log4j.Category" %>
<%@ page import="com.oval.foundation.DefaultParams" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/oval-tag.tld" prefix="oval" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

<%
  	Category cat = Category.getInstance("jsp.NotesAccessoryView");
  	//init param
    String strModuleName = "BIEE";
    String privilegeCode = "Z0404";
    String contextPath = request.getContextPath();
    String path = ConstantProp.DEFAULT_IMG_SRC;//"../../uploads/";
%>




<%@ include file="/inc/PageDefault.inc" %>
<html>

<head>
<title>NotesAccessory</title>
<PageFlow:CheckPageFlow pageName="notesaccessory"/>
<%@ include file="/inc/SumDiv.inc" %>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<%=contextPath%>/css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="<%=contextPath%>/css/<%= strLanguageCode %>/script.js">
</script>
<script language="JavaScript" src="<%=contextPath%>/js/FuncLib.js">
</script>
<script language="JavaScript" src="../js/SummaryDivision.js"></script>
<script language="JavaScript">
function page_summary(actionvalue,orderbyname)
{
  var editform = summaryPrepare(document.cform, actionvalue, orderbyname);
  if (editform == false)
      return;
  editform.action = "NotesAccessoryView.jsp?<%= OvalTools.randomURL() %>";
  editform.target = "_self";
  isRunning = true;
  editform.submit();
}
function page_download(savefilename,filename){
	document.cform.filename.value=filename;
	document.cform.savefilename.value=savefilename;
	//alert(document.cform.filename.value);
	//alert(document.cform.savefilename.value);
	cform.actionname.value = "download";
	cform.target = "_self";
	//isRunning = true;
	cform.submit();
}
</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" >


<form name="cform" method="post" action="../Dispatcher">
<input type="hidden" name="pagename" value="notesaccessory">
<input type="hidden" name="actionname">
<custom:hidden property="notesid"/>
<custom:hidden property="filename"/>
<custom:hidden property="savefilename"/>
<table width="100%" cellspacing="0" cellpadding="0" border="0" align="center">
    <tr>
        <td valign=top>
          <table width="100%" border="0" cellpadding="1" cellspacing="0" align="center">
              <tbody>
                  <tr>
                        <td bgcolor=#000000 style="PADDING-BOTTOM: 1px; PADDING-LEFT: 1px; PADDING-RIGHT: 1px; PADDING-TOP: 0px">
                            <table bgcolor=#000000 border=0 cellpadding=0 cellspacing=0 width="100%">
                                <tr>
                                    <td  bgcolor=#ffffff style="PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; PADDING-TOP: 3px">
                                        <div id=div1 style="HEIGHT: 270px; OVERFLOW: auto">
                                            <%--<table width="100%" border="1" cellpadding="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0" align="center">
                                                <tr class="deepblue-left">
                                                    <td class="title_center" ><a href="javascript:page_summary('orderby','attachmentname')"><%= label.getLabelName("L_AttachName")%></a></td>
                                                    <td class="title_center" ><a href="javascript:page_summary('orderby','filename')"><%= label.getLabelName("L_FileName")%></a></td>
                                                    <td class="title_center"  ><a href="javascript:page_summary('orderby','filesize')"><%= label.getLabelName("L_FileSize")%></a></td>
                                                    <td class="title_center"  ><a href="javascript:page_summary('orderby','filetype')"><%= label.getLabelName("L_FileType")%></a></td>
                                                    <td class="title_center"  ><a href="javascript:page_summary('orderby','comments')"><%= label.getLabelName("L_comment")%></a></td>
                                                </tr>
                                                   <%
                                                      Vector attachment = (Vector)pageContext.getAttribute("attachment");
                                                      if(attachment == null)
                                                      {
                                                          attachment = new Vector();
                                                      }
                                                      String strClassType = "";
                                                      int i=0;
                                                   %>
                                                   <logic:iterate id="attach" collection="<%= attachment %>">
                                                   <%

                                                     if(i%2 == 1)
                                                     {
                                                       strClassType = "td-listrom";
                                                     }else{
                                                       strClassType = "none";
                                                     }
                                                     i++; 
                                                     
                                                     HashMap file = (HashMap)pageContext.getAttribute("attach");
                                                     String tempfilename="";
                                                     if(file!=null)
                                                     {
                                                         String temp =(String)file.get("filename");
                                                         tempfilename= path + temp;
                                                         /*System.out.println("path:"+path);
                                                         System.out.println("temp:"+temp);
                                                         System.out.println("tempfilename:"+tempfilename);*/
                                                     }
//                                                     String ppp = path +  (String)((HashMap)pageContext.getAttribute("attach")).get("filename");
                                                   %>
                                                      <tr>
                                                        <td>&nbsp;<oval:write property="attachmentname" name="attach"/></td>
                                                        <td>&nbsp;<a href="..<%=tempfilename%>" target="_new"><oval:write property="filename" name="attach"/></a></td>
                                                        <td>&nbsp;<oval:write property="filesize" name="attach"/></td>
                                                        <td>&nbsp;<oval:write property="filetype" name="attach"/></td>
                                                        <td>&nbsp;<oval:write property="comments" name="attach"/></td>
                                                      </tr>
                                                    </logic:iterate>
                                                    <%@include file="/inc/SummaryAction.inc" %>
                                            </table>--%>
                                            <table width="100%" border="1" cellpadding="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0" align="center">
                                                <tr class="deepblue-left">
                                                	<td class="title_center" width="8%"><%= label.getLabelName("L_Seq")%></td>
                                                    <td class="title_center" ><a href="javascript:page_summary('orderby','picturename')"><%= label.getLabelName("L_AttachName")%></a></td>
                                                    <td>&nbsp;</td>
                                                </tr>
                                                   <%
                                                      Vector pictures = (Vector)pageContext.getAttribute("pictures");
                                                      if(pictures == null)
                                                      {
                                                    	  pictures = new Vector();
                                                      }
                                                      String strClassType = "";
                                                      int i=0;
                                                   %>
                                                   <logic:iterate id="picture" collection="<%= pictures %>">
                                                   <%

                                                     if(i%2 == 1)
                                                     {
                                                       strClassType = "td-listrom";
                                                     }else{
                                                       strClassType = "none";
                                                     }
                                                     i++;

                                                     HashMap psMap = (HashMap)picture;
                         					         String regEx= "/.doc$|.pdf$|.ppt$|.txt$|.xls$|.gif$|.bmp$|.jpg$|.jpeg$/ig";
                         					         String str="";
                         					         String ContextPath=request.getContextPath();
                         					         String strFileDir=DefaultParams.findParam("uploadfilepath");

                         					         String downloadstr ="";
                         					         if(strFileDir!=null){
                         					        	strFileDir=strFileDir+psMap.get("picturename");
                                                           // downloadstr = "../DownLoadCadbury.jsp?downloadpath="
                                                          //    +java.net.URLEncoder.encode(strFileDir,"UTF-8")
                         						           //  +"&filename="
                         						            // +java.net.URLEncoder.encode((String)psMap.get("picturename"),"UTF-8")
                                                           //   +"&truefilename="
                                                           //   +java.net.URLEncoder.encode((String)psMap.get("picturename"),"UTF-8");
                                                     }
                                                   %>
                                                      <tr>
                                                        <td class="title_center">&nbsp;<%= i %></td>
                                                        <td class="title_center">&nbsp;<%= psMap.get("picturename") %></td>
                                                        <td><a onclick="page_download('<%= java.net.URLEncoder.encode((String)psMap.get("picturename"),"UTF-8") %>','<%=strFileDir %>')"><custom:button type="1" label="L_Download" imgsrc="edit.gif" border="0" style="width:80"/></a>
                                                        </td>
                                                  
                                                  
                                                      </tr>
                                                    </logic:iterate>
                                                    <%@include file="/inc/SummaryAction.inc" %>
                                            </table>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
              </tbody>
          </table>
        </td>
      </tr>
      <tr>
        <td class="summary_top"></td>
      </tr>

</table>
</form>
</body>
</html>


